Skip to content

Fix potential invalid memory access in StringSplitter#2996

Merged
wwbmmm merged 1 commit into
apache:masterfrom
gitccl:fix_string_splitter
Jun 16, 2025
Merged

Fix potential invalid memory access in StringSplitter#2996
wwbmmm merged 1 commit into
apache:masterfrom
gitccl:fix_string_splitter

Conversation

@gitccl

@gitccl gitccl commented Jun 14, 2025

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Problem Summary:
This patch fixes potential invalid memory access in StringSplitter and StringMultiSplitter.
Previously, loops such as for (; *_tail != _sep && not_end(_tail); ++_tail) dereferences _tail before confirming it's within the buffer range, potentially causing undefined behavior when _tail reaches the end of the buffer.

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects:

  • Breaking backward compatibility:


Check List:

@chenBright chenBright left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wwbmmm wwbmmm merged commit 10f8b24 into apache:master Jun 16, 2025
15 checks passed
@gitccl gitccl deleted the fix_string_splitter branch June 16, 2025 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants